package com.ghck.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ghck.server.dao.provider.FriendsCategoryDictProvider;
import com.ghck.server.model.FriendsCategoryDict;
import com.ghck.server.model.query.FriendsCategoryDictQuery;
/**
 * 亲友关系字典表  <br>
 * dict_friends_category <br>
 * v1.0 2016-05-08
 */
 public interface FriendsCategoryDictMapper {
 	
 	/**
 	*根据id删除 亲友关系字典表
 	*/
 	@Delete("delete from dict_friends_category where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	/**
 	* 批量新增 亲友关系字典表
 	*/
 	@InsertProvider(method="batchInsert",type=FriendsCategoryDictProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends FriendsCategoryDict> friendsCategoryDicts);
 	
 	/**
 	* 新增 亲友关系字典表
 	*/
 	@InsertProvider(method="insert",type=FriendsCategoryDictProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(FriendsCategoryDict domain);
 
 	
 	/**
 	*更新 亲友关系字典表
 	*/
 	@UpdateProvider(method="update",type=FriendsCategoryDictProvider.class)
 	public Integer update(FriendsCategoryDict domain);
 	
 	/**
 	*根据ID查询 亲友关系字典表
 	*/
	@Select("select * from dict_friends_category where id=#{id}")
	public FriendsCategoryDict findById(Integer id);
	
	/**
 	*通过query 查询 亲友关系字典表
 	*/
 	@SelectProvider(method="findByQuery",type=FriendsCategoryDictProvider.class)
 	public List<FriendsCategoryDict> findByQuery(FriendsCategoryDictQuery query);
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=FriendsCategoryDictProvider.class)
 	public Integer countByQuery(FriendsCategoryDictQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=FriendsCategoryDictProvider.class)
 	public List<FriendsCategoryDict> findByIds(List<Integer> ids);
 	
 	 /**
 	*根据name查询 亲友关系字典表
 	*/
	@Select("select * from dict_friends_category where name=#{name} limit 1")
	public FriendsCategoryDict findByName(String name);
	
	/**
 	*获取所有字典 亲友关系字典表
 	*/
	@Select("select * from dict_friends_category")
	public List<FriendsCategoryDict> findAll();
	

}	